<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body v-app="app">

<div v-viewport="main" href="testpage2.html" history="true" apply="true">
        {{hello}}
</div>

<form name="zhuce" v-submit="gotopage2()">
    <div>
        username
        <input type="text" name="username"  required>
        shoujihao
        <input type="text" name="shoujihao"  maxlength="11">
        jine
        <input type="text" name="jine"  max="111">
        <button>tijiao</button>
        <!--触发  v-submit 方法
            有name熟悉
        -->
    </div>

</form>

    <script  type="text/javascript" src="../vx/jquery-3.2.1.js"></script>
    <script  type="text/javascript" src="../vx/vx.js"></script>

    <script>
        var app = vx.module("app",[]);
        app.controller("vc",function ($scope, $targets ) {
            $scope.gotop1=function () {
                $targets("main","#+1");
            }

            $scope.gotop2=function () {
                $targets("main","#+1");
            }
        })

//        注册组件  自定义指令
        app.directive("getcode",function ($scope,$target,$http) {
            return{
//                restrict:"EA"   element  attr
//                scope
//                    获取外面的值
//                                @外面定义的属性值   =对象  名称相同时 可以省略写一个=
//                template:"<button>获取验证码</button>";
//                templateurl
//                compilate  编译
//                    return this.link
//                link 连接指令和controller 和scope
//                    scope element attr
            }
        })


//        http   then
/*
    json格式

    表单校验



* */
    </script>
</body>
</html>